package net.cassandraview.utils;

import javax.el.ELContext;
import javax.el.ELResolver;
import javax.faces.context.FacesContext;

public class BasicUtils {
	
	@SuppressWarnings("unchecked")
	public static <T> T resolveElVariable(Class<T> cls, String el) {
		FacesContext fctx = FacesContext.getCurrentInstance();
		ELContext ectx = fctx.getELContext();
		ELResolver elresolver = ectx.getELResolver();
		return (T) elresolver.getValue(ectx, null, el);
	}
	
}
